import { S } from '../../s';
import { PSMDAjaxControlContainerImpl } from '../psmdajax-control-container-impl';
import { IPSSysMap } from './ipssys-map';
import { IPSSysMapItem } from './ipssys-map-item';
import { IPSLanguageRes } from '../../res/ipslanguage-res';

export class PSSysMapImpl
  extends PSMDAjaxControlContainerImpl
  implements IPSSysMap
{
  get codeName(): string {
    return this.M.codeName;
  }

  get emptyText(): string {
    return this.M.emptyText;
  }

  protected emptytextpslanguageres: IPSLanguageRes;
  getEmptyTextPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.emptytextpslanguageres ||
      (this.emptytextpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getEmptyTextPSLanguageRes,
        S._2b4,
      ) as IPSLanguageRes)
    );
  }

  get legendPos(): 'LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM' | 'NONE' {
    return this.M.legendPos;
  }

  get mapStyle(): 'USER' | 'USER2' {
    return this.M.mapStyle;
  }

  protected pssysmapitems: IPSSysMapItem[];
  getPSSysMapItems(): IPSSysMapItem[] | null {
    return (
      this.pssysmapitems ||
      (this.pssysmapitems = this.fillChildListModel(
        this.M.getPSSysMapItems,
        S._126,
      ) as IPSSysMapItem[])
    );
  }

  findPSSysMapItem(objKey: any): IPSSysMapItem | null {
    return this.getPSModel5(
      S._126,
      this.getPSSysMapItems(),
      objKey,
    ) as IPSSysMapItem;
  }

  hasWFDataItems(): boolean {
    return this.M.hasWFDataItems;
  }
  get cls(): string {
    return 'PSSysMapImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._249) return true;
    return super.instanceof(cls);
  }
}
